<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ include file="/taglibs.jsp"%>
<%@ taglib uri="http://www.yaodian100.com/jsp/yaodian100" prefix="yaodian100" %>
<c-rt:set var="midContextPath" value='<%=ServerValue.getMidContextPath() %>'/>

<!-- 月历 -->
<script type="text/javascript" charset="UTF-8" src="/js/jquery.datepick.js"></script>
<script type="text/javascript" charset="UTF-8" src="/js/jquery.datepick-zh-CN.js"></script>
<link rel="stylesheet" type="text/css" href="/css/smoothness.datepick.css" />
<script type="text/javascript" charset="UTF-8" src="/js/jquery.alphanumeric.js"></script>
<script type="text/javascript" charset="UTF-8" src="/js/jquery.autotab-1.1b.js"></script>
<script>
	$().ready( function() {
		$('#expectedOnlineDate').datepick({minDate: new Date(), showOn:'both',numberOfMonths:2, buttonImageOnly: true, buttonImage: '/images/calendar.gif',dateFormat:"yy-mm-dd"});

		$("#previewButton").click(function(){
			$("#pageOutputForm").attr("target","_blank");
			$("#pageOutputForm").attr("action","./preview.do");
			$("#pageOutputForm").submit();
			return false;
		});

		$("#generateButton").click(function(){
			if (!validateOutput()) return false;
			$("#pageOutputForm").attr("target","_self");
			$("#pageOutputForm").attr("action","./generate.do");
			$("#pageOutputForm").submit();
			return false;
		});

		function validateOutput() {
			if ($("#expectedOnlineDate").val() == "") {
				alert("请输入活动上线日");
				$("#expectedOnlineDate").focus();
				return false;
			}

			if ($("#customFileName").val() == "") {
				alert("请输入自定档名");
				$("#customFileName").focus();
				return false;
			}

			return true;
		}
		
		$("#customFileName").alphanumeric({
			allow:"-"
		});
		$("#customFileName").autotab_filter({ format: 'custom', pattern: '[^a-zA-Z0-9\-]' });

	});
</script> 
		
<s:actionerror />
<s:actionmessage />
<s:fielderror />
<div class="product">
	<div class="f-link">
		<a href="../page/search.do">回活动页面列表</a>
	</div>
	<br>
	<h1>活动页面管理</h1>
	<div class="stepflow">
		<span class="firstone off">
			<a href="../page/editPage.do?activityPage.id=${activityPage.id}">设置活动主视觉与商品</a><b>&nbsp;</b>
		</span>
		<span class="lastone on">
			<strong>预览及储存</strong>
			<b>&nbsp;</b>
		</span>
	</div>
	<p class="txt-L">
		<strong><span class="txt-rd">＊</span> 4. 选择页面样式：</strong> <span
			class="txt-s"><a href="http://10.0.0.20/art/act_template/template_style.html"
			target="_blank">点我看样式</a>
		</span>
	</p>
	<s:form name="pageOutputForm" id="pageOutputForm" action="" method="post">
		<s:hidden name="activityPage.id"/>
		<c-rt:forEach items="${styleGroups}" var="styleGroup" varStatus="group_status">
			<ul class="act-style-select">
				<c-rt:forEach items="${styleGroup.styles}" var="style" varStatus="style_status">
					<li>
						<label><input name="activityPage.styleId" type="radio" value="${style.id}" class="ipt-radio" <c:if test="${(activityPage.styleId==null && group_status.count==1 && style_status.count==1) || activityPage.styleId == style.id}">checked="checked"</c:if> >${style.name}</label>
					</li>
				</c-rt:forEach>
			</ul>
		</c-rt:forEach>
		<p class="txt-L">
			<strong><span class="txt-rd">＊</span> 5. 活动上线日：</strong>
			<s:textfield name="expectedOnlineDate" id="expectedOnlineDate" size="20" maxlength="10"/>
			<span class="title-note">（例：预计2011年5月11号上线的活动，请输入2011-05-11）</span>
		</p>
		<p>
			<strong><span class="txt-rd">＊</span> 6. 自定档名：</strong>
			<s:textfield name="activityPage.customFileName" id="customFileName" size="20"/>
			（请输入活动馆别关键字,仅限英数字及「-」, 例如: 居家线的活动, 输入自定档名life即可） 
		</p>
		<p>
			<span class="title-note">注：活动网址规则将会命名为
				http://www.yaodian100.com/act/pm/system/活动预期上线日/ 活动预期上线日_自訂檔案名.html</span><br>
			<span class="title-note">例：http://www.yaodian100.com/act/pm/system/20110511/20110511_lofe.html</span>
		</p>
		<p class="f-link">
			<a href="#" id="previewButton"
				target="_blank"><strong>预览页面</strong>
			</a>
			<yaodian100:checkPermission permissions="ROLE_ACTIVITY_MANAGER"><a href="#" id="generateButton">页面生成上传</a></yaodian100:checkPermission> <a
				href="../page/search.do">回活动页面列表</a>
		</p>
	</s:form>
</div>



